package com.example.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.sys.entity.Leaved;
import com.example.sys.entity.User;
import com.example.sys.mapper.LeavedMapper;
import com.example.sys.mapper.RoleMenuMapper;
import com.example.sys.mapper.UserMapper;
import com.example.sys.service.ILeavedService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.sys.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wuage
 * @since 2023-12-24
 */
@Service
public class LeavedServiceImpl extends ServiceImpl<LeavedMapper, Leaved> implements ILeavedService {


    @Resource
    private UserMapper userMapper;

    @Override
    public void addleave(Leaved leaved) {
        String username = userMapper.selectById(leaved.getUserId()).getUsername();
        leaved.setUserName(username);
        this.save(leaved);
    }
}
